﻿@model SubjectHistoryModel
@{
    CssLink.Add("~/Content/css/history.css");
    int 번호 = 1; 
}

<div class="controls pull-right">
    <div class="btn-group">
        <a class="btn dropdown-toggle btn-small" data-toggle="dropdown">보기<span class="caret"></span></a>
        <ul class="dropdown-menu">
            <li><a href="@Url.SubjectDetail(Model.주제.ID)">주제 보기로 돌아가기</a></li>
            <li><a href="@Url.SubjectRemoved(Model.주제.ID)">제거된 항목 보기</a></li>
        </ul>
    </div>
</div>

<h1>@Model.주제.제목 <small>(주제 편집내역)</small></h1>
<hr />

<h2>글 편집 횟수</h2>
<table class="table table-condensed table-bordered" id="글편집횟수">
    <thead>
        <tr><th></th>
            <th>글 제목</th>
            <th>편집 횟수</th>
            <th>작성자</th>
            <th>편집일</th></tr>
    </thead>
    <tbody>
        @{ 번호 = 1; }
        @foreach(var 글 in Model.글목록) {
            <tr onclick="document.location='@Url.ArticleHistory(글.ID)';">
                <td> @(번호++). </td>
                <td style="color:blue;">@글.제목 @if (글.제거됨) { <span class="mytag">주제에서 제거됨</span> }</td>
                <td>@글.편집수</td>
                <td>@글.작성자</td>
                <td>@글.생성일.ToYMDHM()</td>
            </tr>
        }
    </tbody>
</table>
<hr />

<h2>주제 편집내역</h2>
<table class="table table-condensed table-bordered" id="편집내역목차">
    <thead>
        <tr><th>편집유형</th>
            <th>작업 내용</th>
            <th>작성자</th>
            <th>편집일</th></tr>
    </thead>
    <tbody>
        @foreach(var 항목 in Model.편집목록) {
            <tr onclick="document.location='#@항목.ID';">
                <td>@항목.편집유형</td>
                <td>@항목.제목</td>
                <td>@항목.편집자</td>
                <td>@항목.편집일.ToYMDHM()</td>
            </tr>
        }
    </tbody>       
</table>


@foreach(var 항목 in Model.편집목록) {    
    <a id="@항목.ID"></a>
    <div class="편집내역">
        <div class="제목">
            <i class="icon-play"></i>
            @항목.제목
        </div>
        <div class="머리">
            <span class="레이블">편집자:</span> @항목.편집자
            <span class="레이블">편집일:</span> @항목.편집일.ToYMDHM()
            <span class="레이블">편집유형:</span> @항목.편집유형
        </div>
        <div class="내용">
            @Html.Raw(항목.내용)
        </div>    
    </div>
}
